import { useSearchParams} from "react-router-dom";


const details = [
    {id: 1, detail: 'detail001'},
    {id: 2, detail: 'detail002'},
    {id: 3, detail: 'detail003'},
]

const MessageDetail = function () {
    let [searchParams] = useSearchParams();
    let id= searchParams.get("id");
    let value = searchParams.get("value");
    let findItem =details.find(t=>t.id.toString()=== id);

    return (
        <div>
            <p>{id}</p>
            <p>{value}</p>
            <p>{findItem?.detail}</p>
        </div>
    );
}

export default MessageDetail;